import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 二级包装分页查询
 * @param {查询条件} data
 */
export function pageProdTwoPack(query) {
  return request({
    url: 'ProdManage/ProdTwoPack/pageList',
    method: 'get',
    params: query,
  })
}

/**
 * 新增二级包装
 * @param data
 */
export function addProdTwoPack(data) {
  return request({
    url: 'ProdManage/ProdTwoPack',
    method: 'post',
    data: data,
  })
}
/**
 * 修改二级包装
 * @param data
 */
export function updateProdTwoPack(data) {
  return request({
    url: 'ProdManage/ProdTwoPack',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取二级包装详情
 * @param {Id}
 */
export function getProdTwoPack(id) {
  return request({
    url: 'ProdManage/ProdTwoPack/' + id,
    method: 'get'
  })
}

/**
 * 删除二级包装
 * @param {主键} pid
 */
export function delProdTwoPack(pid) {
  return request({
    url: 'ProdManage/ProdTwoPack/delete',
    method: 'POST',
    data: pid
  })
}
// 导出二级包装
export async function exportProdTwoPack(query) {
  await downFile('ProdManage/ProdTwoPack/export', { ...query })
}
